#ifndef SESSION_H
#define SESSION_H

#include <boost/asio.hpp>
#include <memory>

class Session : public std::enable_shared_from_this<Session> {
public:
    Session(boost::asio::io_service& _ioService);
    ~Session(void);

    void start(void);
    boost::asio::ip::tcp::socket& socket(void);
    void send_data();

private:
    void write_handler(const boost::system::error_code& _error);

    boost::asio::ip::tcp::socket socket_;
    int measurement;
    double time_diff;
    double speed;
    char msg_[1024]; // 可根据需要调整消息缓冲区大小
};

#endif // SESSION_H
